package cn.wolfcode.trip.admin.controller;

import cn.wolfcode.trip.base.domain.StrategyComment;
import cn.wolfcode.trip.base.query.StrategyCommentQueryObject;
import cn.wolfcode.trip.base.service.IStrategyCommentService;
import cn.wolfcode.trip.base.util.JSONResult;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 评论管理资源控制器
 *
 * @author totoro93
 * @date 2019-01-14
 **/
@Controller
@RequestMapping("/strategyComment")
public class StrategyCommentController {
    @Autowired
    private IStrategyCommentService strategyCommentService;


    @RequestMapping("/list")
    public String list(@ModelAttribute("qo") StrategyCommentQueryObject queryObject, Model model) {

        queryObject.setOrderBy("sc.createTime desc");
        PageInfo pageInfo = strategyCommentService.query(queryObject);
        model.addAttribute("pageInfo", pageInfo);
        return "strategyComment/list";
    }







}
